/*
* BankApplication
*
* r2
*
* GNU General Public License v3.0
*/

package com.acme.bankapp;

import com.acme.bankapp.domain.bank.*;
import com.acme.bankapp.service.bank.*;

public class BankApplication {

	public static void main(String[] args) {
		Bank bank = new Bank();
		BankService bankService = new BankService();
		
		bankService.addClient(bank, new Client("Putin", Gender.MALE), new CheckingAccount(0, 1000000));
		bankService.addClient(bank, new Client("Ann", Gender.FEMALE), new SavingsAccount(100), new CheckingAccount(100, 1000));
		bankService.addClient(bank, new Client("Ya", Gender.MALE), new CheckingAccount(200, 1000));
		bankService.addClient(bank, new Client("Noob", Gender.FEMALE), new SavingsAccount(300));
		
		modifyBank(bank);
		
		bankService.printMaximumAmountToWithdraw(bank);
	}
	
	private static void modifyBank(final Bank bank) {
		bank.getClients().get(0).getAccounts().get(0).withdraw(100);
		bank.getClients().get(1).getAccounts().get(0).deposit(100);
		bank.getClients().get(2).getAccounts().get(0).withdraw(25);
		bank.getClients().get(2).getAccounts().get(0).deposit(598);
		bank.getClients().get(2).getAccounts().get(0).withdraw(478);
	}
	
}
